package com.scpii.universal.pns.service;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.scpii.universal.hibernate.dao.BaseDao;
import com.scpii.universal.hibernate.entity.AppPageTab;
import com.scpii.universal.hibernate.intface.BaseInterface;
import com.scpii.universal.pns.hibernate.entity.FieldValues;

public class FieldValuesService implements BaseInterface<FieldValues> {
	private BaseDao<FieldValues> fieldValuesDao;
	
	public void setFieldValuesDao(BaseDao<FieldValues> fieldValuesDao) {
		this.fieldValuesDao = fieldValuesDao;
	}

	@Override
	public FieldValues get(Integer id) throws Exception {
		return fieldValuesDao.get(id);
	}

	@Override
	public List<FieldValues> getAll() throws Exception {
		return null;
	}

	@Override
	public FieldValues get(String propertyName, Object value) throws Exception {
		return null;
	}

	@Override
	public List<FieldValues> getList(String propertyName, Object value)
			throws Exception {
		return null;
	}

	@Override
	public Long getTotalCount() throws Exception {
		return null;
	}

	@Override
	public void save(FieldValues obj) throws Exception {
		
	}

	@Override
	public void update(FieldValues obj) throws Exception {
		
	}

	@Override
	public void delete(FieldValues obj) throws Exception {
		
	}

	@Override
	public void delete(Integer id) throws Exception {
		
	}

	@Override
	public List<FieldValues> hqlGetList(String hql, Map<String, Object> argsMap)
			throws Exception {
		return null;
	}

	@Override
	public void hqlUpdate(String namedHqlQuery, Map<String, Object> argsMap)
			throws Exception {
		
	}

	@Override
	public Long hqlGetNums(String namedHqlQuery, Map<String, Object> argsMap)
			throws Exception {
		return null;
	}

	@Override
	public List<FieldValues> sqlGetList(String sqls, Map<String, Object> argsMap)
			throws Exception {
		return null;
	}

	@Override
	public void sqlUpdate(String sqls, Map<String, Object> argsMap)
			throws Exception {
		
	}

	@Override
	public Long sqlGetNum(String sqls, Map<String, Object> argsMap)
			throws Exception {
		return null;
	}

	public FieldValues getValuesByFieldTargetId(Long fieldId,Long targetId) throws Exception {
		Map<String, Object> argsMap = new HashMap<String, Object>();
		argsMap.put("fieldId", fieldId);
		argsMap.put("targetId", targetId);
		List<FieldValues> result = fieldValuesDao.hqlGetList("GET_VALUES_BY_FIELDID_TARGETID", argsMap);
		if(result == null || result.size() <= 0) {
			return null;
		}
		return result.get(0);
	}
}
